<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>generatePage</title>
    <style>
        /*日期框图标撑满全框
           但是图标本身却在框外*/
        .param::-webkit-calendar-picker-indicator {
            position: absolute;
            right: 0;
            padding-left: calc(100% - 24px);
            padding-right: 8px;
        }

        /* 日期标签定宽
           将日期图标收回矿中*/
        .param {
            position: relative;
            width: 200px;
            height: 25px;
        }

        .submit {
            background-color: dodgerblue;
            color: white;
            border: none;
            width: 60px;
            height: 25px;
            border-radius: 3px;
            margin-top: 10px;
            cursor: pointer;
        }
    </style>
</head>
<body>
<form role="form" action="/zhang/excel" method="post" style="text-align: center">
    日期：<input type="month" id="param" name="param" class="param"> <br>
    <input type="submit" id="generatePage" class="submit" value="提交">
</form>
</body>
</html>
<script type="text/javascript">
    // 显示默认日期
    var time = new Date();
    var month = ("0" + (time.getMonth() + 1)).slice(-2);
    var currentMonth = time.getFullYear() + "-" + (month);
    document.getElementById('param').value = currentMonth;
</script>
